package business.impls.stores;

import business.interfaces.stores.VocabularyStore;
import business.interfaces.classes.Vocabulary;
import business.interfaces.commons.DataProvider;
import business.impls.classes.implVocabulary;
import business.impls.commons.jdbcTable;
import business.impls.commons.implAbitSystemData;

import java.util.Properties;

/**
 * Created by IntelliJ IDEA.
 * User: admin
 * Date: 08.04.2005
 * Time: 0:47:52
 * To change this template use File | Settings | File Templates.
 */
public class implVocabularyStore extends implAbitSystemData implements VocabularyStore{


    public Vocabulary getVocabulary(String Name) {
        implVocabulary tmp = new implVocabulary();
        jdbcTable tbl =  prov.getSQLStore();
        tbl.setQuery("select * from "+Name+" order by ID;");
        tbl.Prepare();
        int p = tbl.getRowCount();
        //if (p>5) p=5;
        for (int i=0;i<p;i++){
            tmp.setNameIDPair((Integer)tbl.getValueAt(i,tbl.getColumnIndex("ID")),((String)tbl.getValueAt(i,tbl.getColumnIndex("Name"))));
        }
        return tmp;
    }

    public boolean CheckForUpdate() {
        return false;  //To change body of implemented methods use File | Settings | File Templates.
    }

    public void Reload() {
        //To change body of implemented methods use File | Settings | File Templates.
    }


}
